﻿namespace Ops.Host.App.ViewModels;

public sealed class MarkingViewModel : AsyncSinglePagedViewModelBase<PtMarking, MakingFilter>, IViewModel
{
    private readonly IPtMarkingService _markingService;

    public MarkingViewModel(IPtMarkingService markingService)
    {
        _markingService = markingService;
    }

    protected override void OnExcelModelCreating(ExcelModelBuilder builder)
    {
        builder.ExcelName = $"打标数据";
        builder.HasExcelNameDatePostfix = true;
    }

    protected override async Task<PagedList<PtMarking>> OnSearchAsync(int pageIndex, int pageSize)
    {
        return await _markingService.GetPagedListAsync(QueryFilter, pageIndex, pageSize);
    }
}
